import { getProcess, repairPross } from 'service/actions/process';
export default {
  namespace: 'processRepair',
  state: {
    list: [],
  },

  effects: {
    // 获取列表数据
    *getList({ payload: { id } }, { put, call }) {
      const data = yield call(getProcess, id);
      yield put({
        type: 'updateState',
        payload: { list: data.data },
      });
    },

    // 处理流程业务
    *approvePro({ payload }, { call }) {
      const data = yield call(repairPross, payload);
      return data
    },
  },

  reducers: {
    // 更新List
    updateState(state, { payload: { list } }) {
      return { ...state, list };
    },
  },
  subscriptions: {},
};
